<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }

    /* .wrapper::after {
      display: block;
      width: 0;
      height: 0;
      content: '.';
      visibility: hidden;
      clear: both;
    } */

    .left {
      float: left;
      width: 300px;
      height: 200px;
      background: #bbf;
    }

    .right {
      height: 200px;
      background: #bfc;
    }
  </style>
</head>
<body>
  <h1>float + margin 方案</h1>
  <div class="wrapper">
    <style>
      .wrapper .right {
        margin-left: 300px;
      }
    </style>
    <div class="left">
      <h2>定宽</h2>
    </div>
    <div class="right">
      <h2>自适应</h2>
    </div>
  </div>
  <h1>触发 BFC 方案</h1>
  <div class="bfc-wrapper">
    <style>
      .bfc-wrapper .right {
        overflow: hidden;
      }
    </style>
    <div class="left">
      <h2>定宽</h2>
    </div>
    <div class="right">
      <h2>自适应</h2>
    </div>
  </div>
  <h1>flex 方案</h1>
  <div class="flex-wrapper">
    <style>
      .flex-wrapper {
        display: flex;
      }

      .flex-wrapper .right {
        flex: 1;
      }
    </style>
    <div class="left">
      <h2>定宽</h2>
    </div>
    <div class="right">
      <h2>自适应</h2>
    </div>
  </div>
</body>
</html>
